<!DOCTYPE html>
<html lang="">
  <head>
    
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>


<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<meta name="theme-color" content="#f8f5ec" />
<meta name="msapplication-navbutton-color" content="#f8f5ec">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec">



  <meta name="description" content="Hexo even主题让博客更优雅"/>




  <meta name="keywords" content="程序员, IT, 互联网, 技术, 博客" />










  <link rel="alternate" href="/blog/default" title="咻咻ing">




  <link rel="shortcut icon" type="image/x-icon" href="/blog/favicon.ico?v=2.9.0" />



<link rel="canonical" href="https://xiuxiuing.gitee.io/blog/2018/08/10/blogsetting/"/>



  <link rel="stylesheet" type="text/css" href="/blog/lib/fancybox/jquery.fancybox.css" />




  <link rel="stylesheet" type="text/css" href="/blog/lib/nprogress/nprogress.min.css" />



<link rel="stylesheet" type="text/css" href="/blog/css/style.css?v=2.9.0" />



  
  <script id="baidu_analytics">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?6f2041754dc216e6973762726c19d178";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




  <script id="baidu_push">
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>





  <script src="//cdn1.lncld.net/static/js/3.1.1/av-min.js"></script>
  <script id="leancloud">
    AV.init({
      appId: "CPWqXTBOMHfb978mUUhzNGl5-gzGzoHsz",
      appKey: "NacrB6AlMs6sf7SS5lebu9ln"
    });
  </script>
  <script src="https://c.mipcdn.com/extensions/platform/v1/mip-cambrian/mip-cambrian.js"></script>
            



<script>
  window.config = {"title":"咻咻ing","subtitle":"欢迎关注公众号：咻咻ing","description":"记录一个程序猿的成长历程","author":"xiuxiuing","language":null,"timezone":null,"url":"https://xiuxiuing.gitee.io/blog","root":"/blog/","permalink":":year/:month/:day/:title/","permalink_defaults":null,"source_dir":"source","public_dir":"public","tag_dir":"tags","archive_dir":"archives","category_dir":"categories","code_dir":"downloads/code","i18n_dir":":lang","skip_render":null,"new_post_name":":title.md","default_layout":"post","titlecase":false,"external_link":true,"filename_case":0,"render_drafts":false,"post_asset_folder":true,"relative_link":false,"future":true,"highlight":{"enable":true,"auto_detect":false,"line_number":true,"tab_replace":null},"default_category":"uncategorized","category_map":"cat","tag_map":"tag","date_format":"YYYY-MM-DD","time_format":"HH:mm:ss","per_page":10,"pagination_dir":"page","theme":"even","deploy":{"type":"git","repo":"https://gitee.com/xiuxiuing/blog.git","branch":"master"},"ignore":[],"keywords":"程序员, IT, 互联网, 技术, 博客","index_generator":{"per_page":10,"order_by":"-date","path":""},"archive_generator":{"per_page":10,"yearly":true,"monthly":true,"daily":false},"category_generator":{"per_page":10},"tag_generator":{"per_page":10},"marked":{"gfm":true,"pedantic":false,"sanitize":false,"tables":true,"breaks":true,"smartLists":true,"smartypants":true,"modifyAnchors":"","autolink":true},"server":{"port":4000,"log":false,"ip":"0.0.0.0","compress":false,"header":true},"since":2015,"favicon":"/favicon.ico","rss":"default","menu":{"Home":"/","Archives":"/archives/","Tags":"/tags","Categories":"/categories","About":"/about"},"color":"Default","search":true,"toc":true,"fancybox":true,"pjax":true,"copyright":{"enable":true,"license":"<a rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc/4.0/\" target=\"_blank\">知识共享署名-非商业性使用 4.0 国际许可协议</a>"},"reward":{"enable":true,"qrCode":{"wechat":"http://pd59y0agg.bkt.clouddn.com/%E8%B5%9E%E8%B5%8F.png","alipay":null}},"social":{"email":"xiuxiuing@yeah.net","stack-overflow":null,"twitter":null,"facebook":null,"linkedin":null,"google":null,"github":"https://gitee.com/xiuxiuing/blog","weibo":null,"zhihu":null,"douban":null,"pocket":null,"tumblr":null,"instagram":null},"leancloud":{"app_id":"CPWqXTBOMHfb978mUUhzNGl5-gzGzoHsz","app_key":"NacrB6AlMs6sf7SS5lebu9ln"},"baidu_analytics":"6f2041754dc216e6973762726c19d178","baidu_verification":null,"google_analytics":null,"google_verification":null,"disqus_shortname":null,"changyan":{"appid":null,"appkey":null},"livere_datauid":"MTAyMC8zOTA3MC8xNTU5Nw==","version":"2.9.0"};
</script>

    <title> Hexo even主题让博客更优雅 - 咻咻ing </title>
  </head>

  <body><div id="mobile-navbar" class="mobile-navbar">
  <div class="mobile-header-logo">
    <a href="/blog/." class="logo">咻咻ing</a>
  </div>
  <div class="mobile-navbar-icon">
    <span></span>
    <span></span>
    <span></span>
  </div>
</div>

<nav id="mobile-menu" class="mobile-menu slideout-menu">
  <ul class="mobile-menu-list">
    
      <a href="/blog/">
        <li class="mobile-menu-item">
          
          
            首页
          
        </li>
      </a>
    
      <a href="/blog/archives/">
        <li class="mobile-menu-item">
          
          
            归档
          
        </li>
      </a>
    
      <a href="/blog/tags">
        <li class="mobile-menu-item">
          
          
            标签
          
        </li>
      </a>
    
      <a href="/blog/categories">
        <li class="mobile-menu-item">
          
          
            分类
          
        </li>
      </a>
    
      <a href="/blog/about">
        <li class="mobile-menu-item">
          
          
            关于
          
        </li>
      </a>
    
  </ul>
</nav>

    <div class="container" id="mobile-panel">
      <header id="header" class="header"><div class="logo-wrapper">
  <a href="/blog/." class="logo">咻咻ing</a>
</div>

<nav class="site-navbar">
  
    <ul id="menu" class="menu">
      
        <li class="menu-item">
          <a class="menu-item-link" href="/blog/">
            
            
              首页
            
          </a>
        </li>
      
        <li class="menu-item">
          <a class="menu-item-link" href="/blog/archives/">
            
            
              归档
            
          </a>
        </li>
      
        <li class="menu-item">
          <a class="menu-item-link" href="/blog/tags">
            
            
              标签
            
          </a>
        </li>
      
        <li class="menu-item">
          <a class="menu-item-link" href="/blog/categories">
            
            
              分类
            
          </a>
        </li>
      
        <li class="menu-item">
          <a class="menu-item-link" href="/blog/about">
            
            
              关于
            
          </a>
        </li>
      
    </ul>
  
</nav>

      </header>

      <main id="main" class="main">
        <div class="content-wrapper">
          <div id="content" class="content">
            
  
  <article class="post">
    <header class="post-header">
      <h1 class="post-title">
        
          Hexo even主题让博客更优雅
        
      </h1>

      <div class="post-meta">
        <span class="post-time">
          2018-08-10
        </span>
        
          <div class="post-category">
            
              <a href="/blog/categories/博客搭建/">博客搭建</a>
            
          </div>
        
        
        <div class="post-visits"
             data-url="/blog/2018/08/10/blogsetting/"
             data-title="Hexo even主题让博客更优雅">
            阅读次数 0
          </div>
        
      </div>
    </header>

    
    
  <div class="post-toc" id="post-toc">
    <h2 class="post-toc-title">文章目录</h2>
    <div class="post-toc-content">
      <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#如何开始写作"><span class="toc-text">如何开始写作</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Even主题常用配置"><span class="toc-text">Even主题常用配置</span></a></li></ol>
    </div>
  </div>



    <div class="post-content">
      
        <p>按照博客 <a href="https://xiuxiuing.gitee.io/blog/2018/08/08/giteepage/">使用Gitee+Hexo搭建个人博客</a> 的教程，我们已经成功在Gitee上搭建完成了自己的博客，但是这个博客还是比较简陋的。<br>接下来讲介绍 <em>如何开始写作</em> 和 <em>Even主题的常用配置</em> 。<br><a id="more"></a></p>
<h2 id="如何开始写作"><a href="#如何开始写作" class="headerlink" title="如何开始写作"></a>如何开始写作</h2><p>博客搭建完成，虽然功能很简单，但是已经可以开始写作。</p>
<ul>
<li><p><strong>新建文章</strong><br>使用命令来新建一篇文章：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo new [layout] &lt;title&gt;</span><br></pre></td></tr></table></figure>
<p><code>layout</code> 是文章的布局，默认为<code>post</code>，可以先不写。<br><code>title</code> 是文章的标题，也是文件的名字，存储在<code>source/_posts</code>下。<br>示例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo new demo</span><br></pre></td></tr></table></figure>
<p>则在<code>source/_post</code>目录下自动生成了<code>demo.md</code>文件<br><img src="http://pd59y0agg.bkt.clouddn.com/newdemo.png" alt=""></p>
<p>使用MarkDown编辑器打开文件就可以开始写作了。</p>
</li>
<li><p><strong>Front-matter 设置</strong><br>Front-matter 是文章最上方以 — 分隔的区域，用于指定文章的变量设置，举例来说：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">title: demo</span><br><span class="line">date: 2018-08-23 15:13:30</span><br><span class="line">tags:</span><br><span class="line">---</span><br></pre></td></tr></table></figure>
<p>以下是预先定义的参数，您可在模板中使用这些参数值并加以利用。<br><img src="http://pd59y0agg.bkt.clouddn.com/demotable.png" alt=""></p>
</li>
<li><p><strong>文章分类和标签</strong><br>只有文章支持分类和标签，您可以在 Front-matter 中设置。在其他系统中，分类和标签听起来很接近，但是在 Hexo 中两者有着明显的差别：分类具有顺序性和层次性，也就是说 Foo, Bar 不等于 Bar, Foo；而标签没有顺序和层次。在<code>demo.md</code>增加如下设置，示例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">categories:</span><br><span class="line">- Demo</span><br><span class="line">tags:</span><br><span class="line">- 示例</span><br></pre></td></tr></table></figure>
<p>则会在博客的<code>标签</code>和<code>分类</code>下分别增加我们的配置效果：<br>标签配置效果：<br><img src="http://pd59y0agg.bkt.clouddn.com/demotag.png" alt="标签"></p>
<hr>
<p>分类配置效果：<br><img src="http://pd59y0agg.bkt.clouddn.com/democat.png" alt="分类"><br>说明：文章分类和标签的设置，会自动归档的菜单的分类和标签中。</p>
</li>
<li><p><strong>文章截断</strong><br>在文章内容中添加 <code>&lt;!-- more --&gt;</code> 即可在首页显示时只显示其之上的内容。<br>并且会在 <code>&lt;!-- more --&gt;</code> 添加一个 Read more 的链接。<br>如图：<br><img src="http://pd59y0agg.bkt.clouddn.com/demomore.png" alt="阅读更多"></p>
</li>
<li><p><strong>自定义文章简述</strong><br>可在文章头信息中添加 <code>description</code> 字段，并填写自定义的文章简述。<br>就可以在首页显示文章简述而不显示文章内容, 并自动添加<code>阅读更多</code>的跳转链接。<br><img src="http://pd59y0agg.bkt.clouddn.com/demodes.png" alt=""></p>
</li>
</ul>
<h2 id="Even主题常用配置"><a href="#Even主题常用配置" class="headerlink" title="Even主题常用配置"></a>Even主题常用配置</h2><p>我们博客搭建完成后Hexo的目录结构如下：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">.</span><br><span class="line">├── _config.yml</span><br><span class="line">├── package.json</span><br><span class="line">├── scaffolds</span><br><span class="line">├── source</span><br><span class="line">|   ├── _drafts</span><br><span class="line">|   └── _posts</span><br><span class="line">├── themes</span><br><span class="line">|   ├── even</span><br><span class="line">|   └── landscape</span><br></pre></td></tr></table></figure></p>
<p>我们Even主题的配置则主要在<code>even</code>目录下进行，配置文件<code>_config.yml</code>，目录结构如下：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">.</span><br><span class="line">├── _config.yml</span><br><span class="line">├── package.json</span><br><span class="line">├── scaffolds</span><br><span class="line">├── source</span><br><span class="line">|   ├── css</span><br><span class="line">|   └── js</span><br><span class="line">├── languages</span><br><span class="line">|   ├── default.yml</span><br><span class="line">|   └── zh-cn.yml</span><br><span class="line">|──  layout</span><br></pre></td></tr></table></figure></p>
<ul>
<li><p><strong>修改主题颜色</strong><br>主题自带了 5 种可选的颜色：<br><img src="http://ww1.sinaimg.cn/large/006tNc79gw1faoxeqalb1j318k0drdhj.jpg" alt=""><br>修改主题配置文件中 theme 字段的 color 属性可改变主题色：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"># ===========================================</span><br><span class="line"># Theme Settings</span><br><span class="line"># ===========================================</span><br><span class="line"># theme styling</span><br><span class="line"># color: Default | Mint Green | Cobalt Blue | Hot Pink | Dark Violet</span><br><span class="line">theme:</span><br><span class="line">  color: Default</span><br></pre></td></tr></table></figure>
<p>除了能够修改为主题自带的 5 种颜色之外，还可以使用自定义的其他颜色。<br>在 <code>source/css/_custom/_custom.scss</code> 中添加样式变量 <code>$theme-color</code> 修改主题色。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$theme-color: #xxxxxx;</span><br></pre></td></tr></table></figure>
<p>同时需要修改 <code>$deputy-color</code> 主题副颜色，该值主要使用在代码块背景以及文章目录。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$deputy-color: #xxxxxx;</span><br></pre></td></tr></table></figure>
<p><code>_variables.scss</code> 中的样式变量都可以在 <code>_custom.scss</code> 中进行覆盖，从而自定义主题样式。<br><br></p>
</li>
<li><p><strong>添加分类页</strong><br>使用命令新建一个 categories 页面：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo new page categories</span><br></pre></td></tr></table></figure>
<p>在<code>source</code>目录下自动生成<code>categories</code>目录：<br><img src="http://pd59y0agg.bkt.clouddn.com/democategories.png" alt=""><br>编辑生成的 <code>categories/index.md</code> 文件，设置布局为 <code>categories</code>:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">title: categories</span><br><span class="line">layout: categories</span><br></pre></td></tr></table></figure>
<p>默认开启评论（如果使用了多说或 Disqus），添加 comments 字段并设置为 false 可关闭。</p>
<p>在主题配置文件(<code>_config.yml</code>)中添加链接:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"># ===========================================</span><br><span class="line"># Menu Settings</span><br><span class="line"># ===========================================</span><br><span class="line">menu:</span><br><span class="line">  Home: /</span><br><span class="line">  Archives: /archives/</span><br><span class="line">  Categories: /categories/</span><br></pre></td></tr></table></figure>
</li>
</ul>
<ul>
<li><p><strong>添加标签页</strong><br>使用命令新建一个 tags 页面：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo new page tags</span><br></pre></td></tr></table></figure>
<p>则会自动生成如下目录：<br><img src="http://pd59y0agg.bkt.clouddn.com/demotags.png" alt=""><br>编辑生成的 <code>tags/index.md</code> 文件，设置布局为 tags:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">title: tags</span><br><span class="line">layout: tags</span><br></pre></td></tr></table></figure>
<p>默认开启评论，添加 comments 字段并设置为 false 可关闭。</p>
<p>在主题配置文件(<code>_config.yml</code>)中添加链接:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"># ===========================================</span><br><span class="line"># Menu Settings</span><br><span class="line"># ===========================================</span><br><span class="line">menu:</span><br><span class="line">  Home: /</span><br><span class="line">  Archives: /archives/</span><br><span class="line">  Tags: /tags</span><br></pre></td></tr></table></figure>
</li>
</ul>
<ul>
<li><p><strong>添加自定义页面</strong><br>使用命令新建一个自定义页面（以添加关于页为例）：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo new page about</span><br></pre></td></tr></table></figure>
<p>则会自动生成如下目录：<br><img src="http://pd59y0agg.bkt.clouddn.com/demoabout.png" alt=""><br>编辑生成的 about/index.md 文件，设置布局为 page:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">title: about</span><br><span class="line">layout: page</span><br></pre></td></tr></table></figure>
<p>关于页面的内容，个人相关介绍也是在此页面进行编辑。<br>默认开启评论（如果使用了多说或 Disqus），添加 comments 字段并设置为 false 可关闭。</p>
<p>在主题配置文件(_config.yml)中添加链接:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"># ===========================================</span><br><span class="line"># Menu Settings</span><br><span class="line"># ===========================================</span><br><span class="line">menu:</span><br><span class="line">  Home: /</span><br><span class="line">  Archives: /archives/</span><br><span class="line">  About: /about</span><br></pre></td></tr></table></figure>
<p>在使用的语言文件下添加对应的字段（默认为 languages/default.yml）:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">menu:</span><br><span class="line">  home: Home</span><br><span class="line">  archives: Archives</span><br><span class="line">  tags: Tags</span><br><span class="line">  categories: Categories</span><br><span class="line">  about: About</span><br></pre></td></tr></table></figure>
<p>发布博客后，在首页的菜单中就可以看到我们设置的<code>标签</code> <code>分类</code> <code>关于</code>菜单啦！！！</p>
</li>
<li><p><strong>添加文章访问量统计</strong><br>文章访问量 <code>阅读次数</code> 统计通过 LeadCloud 支持</p>
<p><strong>配置LeanCloud</strong><br>打开LeanCloud官网，进入注册页面注册。完成邮箱激活后，点击头像，进入控制台页面</p>
<p><strong>创建新应用</strong><br>创建一个新应用，并创建名称为 Counter 的 Class（注意权限选择无限制）</p>
<p><strong>配置 app_id 与 app_key</strong><br>在你所创建的应用的 设置-&gt;应用Key 中查看 app_id 与 app_key</p>
<p>修改主题配置文件 <code>_config.yml</code>，填入 <code>app_id</code> 与 <code>app_key</code>:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"># LeanCloud</span><br><span class="line">leancloud:</span><br><span class="line">  app_id:</span><br><span class="line">  app_key:</span><br></pre></td></tr></table></figure>
<p><strong>设置 Web 安全域名</strong><br>在你所创建的应用的 设置-&gt;安全中心 中设置 Web 安全域名 添加你的域名到 Web 安全域名中（若本地服务也想看到访问量，添加 <a href="http://localhost:4000/）" target="_blank" rel="noopener">http://localhost:4000/）</a><br><br></p>
</li>
<li><p><strong>添加博客流量分析</strong><br>博客流量统计、访客地域分布、来源等数据统计通过 <a href="https://tongji.baidu.com/web/23686506/overview/index?siteId=12433455" target="_blank" rel="noopener">百度网站统计</a> 支持</p>
<p><strong>新增网站</strong><br>打开百度网站统计页面，注册相关账号信息，进入到管理页面，点击<code>新增网站</code>，填入相关信息：<br><img src="http://pd59y0agg.bkt.clouddn.com/WX20180820-152623.png" alt="新增网站"><br><strong>代码获取</strong><br>在代码获取页面获取到新版统计代码示例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">&lt;script&gt;</span><br><span class="line">    var _hmt = _hmt || [];</span><br><span class="line">    (function() &#123;</span><br><span class="line">    var hm = document.createElement(&quot;script&quot;);</span><br><span class="line">    hm.src = &quot;https://hm.baidu.com/hm.js?6f2041754dc216e6973762726c19d178&quot;;</span><br><span class="line">    var s = document.getElementsByTagName(&quot;script&quot;)[0];</span><br><span class="line">    s.parentNode.insertBefore(hm, s);</span><br><span class="line">    &#125;)();</span><br><span class="line">&lt;/script&gt;</span><br></pre></td></tr></table></figure>
<p>其中的<code>6f2041754dc216e6973762726c19d178</code>类似我们百度统计分析的APPID。<br><strong>配置百度统计APPID</strong><br>修改主题配置文件 <code>_config.yml</code>，填入 <code>APPID</code>:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"># Baidu Analytics</span><br><span class="line">baidu_analytics: 6f2041754dc216e6973762726c19d178</span><br></pre></td></tr></table></figure>
<p>配置完成后执行<code>hexo -g</code> <code>hexo -d</code>编译发布我们的博客。<br>可以在百度统计分析的<code>代码安装检查</code>页面，点击检查，判断我们的百度分析是否添加成功。<br>添加成功后，差不多20分钟后就可以看到百度统计后台的数据了。<br><img src="http://pd59y0agg.bkt.clouddn.com/demotongji.png" alt="百度统计"><br><br></p>
</li>
</ul>
<ul>
<li><p><strong>设置文章打赏</strong><br>通过主题配置文件中的 reward 字段开启/关闭：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">reward:</span><br><span class="line">  enable: true</span><br><span class="line">  qrCode:</span><br><span class="line">    wechat: /image/reward/wechat.png</span><br><span class="line">    alipay: /image/reward/alipay.png</span><br></pre></td></tr></table></figure>
<p>支持微信以及支付宝，修改 qrCode 下对应的二维码图片链接，也可以直接设置成图片的网络链接。</p>
<p>当开启打赏功能时，可通过文章 Markdown 头部:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">reward: false</span><br></pre></td></tr></table></figure>
<p>关闭该篇文章的打赏。反之，当打赏功能关闭时，可以在文章中单独开启。<br><br></p>
</li>
<li><p><strong>设置底部社交链接</strong><br>目前支持：Email, Stack Overflow, Twitter, Facebook, Github, 微博以及知乎</p>
<p>修改主题配置文件中的 social 字段下的各个字段开启，为空时即为关闭：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">social:</span><br><span class="line">  email: your@email.com</span><br><span class="line">  stack-overflow:</span><br><span class="line">  twitter:</span><br><span class="line">  facebook:</span><br><span class="line">  github:</span><br><span class="line">  weibo:</span><br><span class="line">  zhihu:</span><br></pre></td></tr></table></figure>
<p>主题使用的是自定义的 iconfont 图标库。<br><br></p>
</li>
<li><p><strong>设置文章版权</strong><br>修改主题配置文件中的 copyright 字段开启/关闭：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">copyright:</span><br><span class="line">  enable: true</span><br><span class="line">  # https://creativecommons.org/</span><br><span class="line">  license: &apos;本文采用&lt;a rel=&quot;license&quot; href=&quot;http://creativecommons.org/licenses/by-nc/4.0/&quot;&gt;知识共享署名-非商业性使用 4.0 国际许可协议&lt;/a&gt;进行许可&apos;</span><br></pre></td></tr></table></figure>
<p>默认显示作者，来源，链接以及版权说明，版权说明可通过 <code>copyright.lincese</code> 自定义。</p>
<p><code>copyright.license</code> 的值可以是 HTML</p>
<p>当文章版权信息开启时，可通过文章 Markdown 头部：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">copyright: false</span><br></pre></td></tr></table></figure>
<p>进行单篇文章版权信息的关闭。</p>
</li>
</ul>
<p>至此博客基本配置好了，大家可以愉快的写博客啦！！！<br>配置完成的博客效果可以参考：<a href="https://xiuxiuing.gitee.io/blog/">https://xiuxiuing.gitee.io/blog/</a></p>

      
    </div>

    
      
      

  <div class="post-copyright">
    <p class="copyright-item">
      <span>原文作者: </span>
      <a href="https://xiuxiuing.gitee.io/blog">xiuxiuing</a>
    </p>
    <p class="copyright-item">
      <span>原文链接: </span>
      <a href="https://xiuxiuing.gitee.io/blog/2018/08/10/blogsetting/">https://xiuxiuing.gitee.io/blog/2018/08/10/blogsetting/</a>
    </p>
    <p class="copyright-item">
      <span>许可协议: </span>
      
      <a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/" target="_blank">知识共享署名-非商业性使用 4.0 国际许可协议</a>
    </p>
  </div>



      
      
  <div class="post-reward">
    <input type="checkbox" name="reward" id="reward" hidden />
    <label class="reward-button" for="reward">赞赏支持</label>
    <div class="qr-code">
      
      
        <label class="qr-code-image" for="reward">
          <img class="image" src="http://pd59y0agg.bkt.clouddn.com/%E8%B5%9E%E8%B5%8F.png" title="wechat">
        </label>
      
      
    </div>
  </div>

    

    
      <footer class="post-footer">
        
          <div class="post-tags">
            
              <a href="/blog/tags/Blog/">Blog</a>
            
          </div>
        
        
        
  <nav class="post-nav">
    
      <a class="prev" href="/blog/2018/08/21/studyvideo/">
        <i class="iconfont icon-left"></i>
        <span class="prev-text nav-default">年薪50万的视频资源</span>
        <span class="prev-text nav-mobile">上一篇</span>
      </a>
    
    
      <a class="next" href="/blog/2018/08/08/giteepage/">
        <span class="next-text nav-default">使用Gitee+Hexo搭建个人博客</span>
        <span class="prev-text nav-mobile">下一篇</span>
        <i class="iconfont icon-right"></i>
      </a>
    
  </nav>

      </footer>
    

  </article>


          </div>
          
  <div class="comments" id="comments">
    
      <div id="lv-container" data-id="city" data-uid="MTAyMC8zOTA3MC8xNTU5Nw==">
        <noscript>为正常使用来必力评论功能请激活JavaScript</noscript>
      </div>  
    
  </div>


        </div>
      </main>

      <footer id="footer" class="footer">

  <div class="social-links">
    
      
        
          <a href="mailto:xiuxiuing@yeah.net" class="iconfont icon-email" title="email"></a>
        
      
    
      
    
      
    
      
    
      
    
      
    
      
        
          <a href="https://gitee.com/xiuxiuing/blog" class="iconfont icon-github" title="github"></a>
        
      
    
      
    
      
    
      
    
      
    
      
    
      
    
    
    
      
      <a href="/blog/atom.xml" class="iconfont icon-rss" title="rss"></a>
    
  </div>


<div class="copyright">
  <span class="power-by">
    由 <a class="hexo-link" href="https://hexo.io/">Hexo</a> 强力驱动
  </span>
  <span class="division">|</span>
  <span class="theme-info">
    主题 - 
    <a class="theme-link" href="https://github.com/ahonn/hexo-theme-even">Even</a>
  </span>

  <span class="copyright-year">
    
    &copy; 
     
      2015 - 
    
    2018

    <span class="heart">
      <i class="iconfont icon-heart"></i>
    </span>
    <span class="author">xiuxiuing</span>
  </span>
</div>

      </footer>

      <div class="back-to-top" id="back-to-top">
        <i class="iconfont icon-up"></i>
      </div>
    </div>

    
  
  

  
   <script type="text/javascript">
	(function(d, s) {
       var j, e = d.getElementsByTagName(s)[0];

       if (typeof LivereTower === 'function') { return; }

       j = d.createElement(s);
       j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
       j.async = true;

       e.parentNode.insertBefore(j, e);
   })(document, 'script');
  </script>




    
  



  
  





  
    <script type="text/javascript" src="/blog/lib/jquery/jquery.min.js"></script>
  

  
    <script type="text/javascript" src="/blog/lib/slideout/slideout.js"></script>
  

  
    <script type="text/javascript" src="/blog/lib/fancybox/jquery.fancybox.pack.js"></script>
  

  
    <script type="text/javascript" src="/blog/lib/pjax/jquery.pjax.min.js"></script>
  

  
    <script type="text/javascript" src="/blog/lib/nprogress/nprogress.min.js"></script>
  


    <script type="text/javascript" src="/blog/js/src/even.js?v=2.9.0"></script>

  </body>
</html>
